package hd.cls6;

import java.io.File;

/**
 * @author oldliu
 * @since 1.0
 */
public class FiTet {
    public static void main(String[] args) {
        File[] fr = File.listRoots();
//        for (int i = 0; i < fr.length; i++) {
//            System.out.println(fr[i]);
//        }
        for (File f : fr) {//增强for
            System.out.println(f);
        }
        File f2 = new File("F:", "laowu");
        System.out.println(f2);
        if (f2.exists()) {
            System.out.println("文件ok");

            //f2.delete();
        } else {
            boolean ok = f2.mkdirs();
            System.out.println("创建结果？" + ok);
        }
        System.out.println(f2.getParent());
        //剪切
        //f2.renameTo(new File("F:", "laowu2"));
    }
}
